SET(TARGET_NAME "wx")
SET(TARGET_DIR bin/${BIN_FOLDER}/modules/)

INCLUDE_DIRECTORIES(./)

INCLUDE_DIRECTORIES(${WX_INC_DIR})
LINK_DIRECTORIES (${WX_LIB_DIR})

INCLUDE_DIRECTORIES(${LUA_INC_DIR})
LINK_DIRECTORIES (${LUA_LIB_DIR})

INCLUDE_DIRECTORIES(${LUABIND_INC_DIR})
LINK_DIRECTORIES (${LUABIND_LIB_DIR})

INCLUDE_DIRECTORIES(${BOOST_INC_DIR})
LINK_DIRECTORIES (${BOOST_LIB_DIR})

ADD_DEFINITIONS(${WX_FLAGS})
ADD_DEFINITIONS(-DLUABIND_BINDINGS)

FILE(GLOB_RECURSE PUBLIC_HEADERS "../../include/*.h")

# WRITE_WX_HEADERS()
                                  
# FILE(GLOB_RECURSE COMMON_SOURCE_FILES "*_wrap.cxx")
FILE(GLOB_RECURSE SOURCE_FILES "*.cpp")
FILE(GLOB_RECURSE COMMON_FILES "../sgtApp.cpp")
# FILE(GLOB_RECURSE SOURCE_FILES "register_global_functions.cpp")
# FILE(GLOB_RECURSE CONVERTER_FILES "converter_*.cpp")
# FILE(GLOB_RECURSE CASTER_FILES "dynamicCaster_*.cpp")
FILE(GLOB_RECURSE BINDING_FILES "*_bindings.cxx")

ADD_LIBRARY (${TARGET_NAME} SHARED ${PUBLIC_HEADERS} ${SOURCE_FILES} ${BINDING_FILES} ${COMMON_FILES})

ADD_PRECOMPILED_HEADER( ${TARGET_NAME} ../../include/plug_common.h) 

SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
	PREFIX ""
	SUFFIX ".sgp")
	
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LUABIND_LIBS} ${LUA_LIBS} ${WX_LIBS} ${FLAVOR_LIBS} ${GL_LIBS})  

INSTALL(TARGETS ${TARGET_NAME}
	RUNTIME DESTINATION ${TARGET_DIR}
	LIBRARY DESTINATION ${TARGET_DIR})
	